<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * 日志操作
 */

class Logs extends Auth_Controller {

	function __construct()
	{
		parent::__construct();
	}

	public function index($p = 0)
	{
		//获取所有日志
		$this->load->library('pagination');
		$config['base_url'] = site_url('admini/logs/index');
		$config['total_rows'] = $this->logs->get_count();
		$config['per_page'] = 10;
		$config['page_query_string'] = TRUE;
		$config['first_link'] = '首页';
		$config['last_link'] = '尾页';
		$config['next_link'] = '下一页';
		$config['prev_link'] = '上一页';
		$config['anchor_class'] = 'current';

		//用户分页
		$this->pagination->initialize($config);
		$page = $this->pagination->create_links();

		//信息查询
		$list = $this->logs->get_page($config['per_page']);

		$data = array(
			'page' => $page,
			'list' => $list
		);

		$this->_view('admin/logs_index',$data);

	}
}